package com.oig.sys.msg.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
import java.io.Serializable;


/**
 * @author wuxl
 * 任务表
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "tb_task")
@EntityListeners({AuditingEntityListener.class})
public class TbTask implements Serializable {

	/**
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;

	/**
	 * 任务标题
	 */
	@Column(name = "task_title")
	private String taskTitle;

	/**
	 * 任务内容
	 */
	@Column(name = "task_content")
	private String taskContent;

	/**
	 * 任务优先级 0-低 1-中 2-高
	 */
	@Column(name = "task_priority")
	private String taskPriority;

	/**
	 * 任务重要程度 0-不重要 1-一般 2-重要
	 */
	@Column(name = "task_level")
	private String taskLevel;

	/**
	 * 关联单据类型
	 */
	@Column(name = "relation_type")
	private String relationType;

	/**
	 * 关联单号
	 */
	@Column(name = "relation_id")
	private String relationId;

	/**
	 * 处理人id
	 */
	@Column(name = "deal_id")
	private Integer dealId;

	/**
	 * 处理人名称
	 */
	@Column(name = "deal_name")
	private String dealName;

	/**
	 * 00-未开始 01-进行中 02-已完成
	 */
	@Column(name = "status")
	private String status;

	/**
	 * 预估工时
	 */
	@Column(name = "task_hours")
	private java.math.BigDecimal taskHours;

	/**
	 * 预计开始
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "plan_start_time")
	private java.util.Date planStartTime;

	/**
	 * 预计结束
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "plan_end_time")
	private java.util.Date planEndTime;

	/**
	 * 实际开始时间
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "start_time")
	private java.util.Date startTime;

	/**
	 * 实际完成时间
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "finish_time")
	private java.util.Date finishTime;

	/**
	 * 花费时间
	 */
	@Column(name = "used_hours")
	private java.math.BigDecimal usedHours;

	/**
	 * 跟踪人id
	 */
	@Column(name = "watch_id")
	private Integer watchId;

	/**
	 * 跟踪人名称
	 */
	@Column(name = "watch_name")
	private String watchName;

	/**
	 */
	@CreatedBy
	@Column(name = "create_user_id")
	private Integer createUserId;

	/**
	 */
	@Column(name = "create_user_name")
	private String createUserName;

	/**
	 */
	@CreatedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	private java.util.Date createTime;

	/**
	 */
	@LastModifiedBy
	@Column(name = "last_update_id")
	private Integer lastUpdateId;

	/**
	 */
	@Column(name = "last_update_name")
	private String lastUpdateName;

	/**
	 */
	@LastModifiedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_update_time")
	private java.util.Date lastUpdateTime;

	/**
	 */
	@Version
	@Column(name = "version")
	private Integer version;

	/**
	 */
	@Column(name = "tenant_id")
	private Integer tenantId;

	/**
	 */
	@Column(name = "tenant_name")
	private String tenantName;
}
